import request from '../utils/request'

/**
 * 获取城市列表数据
 * @returns
 */
export const getCityList = () => {
  return request({
    method: 'GET',
    url: '/area/city',
    params: {
      level: 1,
    },
  })
}

/**
 * 获取热门城市数据
 * @returns
 */
export const getHotCityList = () => {
  return request({
    method: 'GET',
    url: '/area/hot',
  })
}

/**
 * 获取当前城市区域的数据
 * @param {*} id
 * @returns
 */
export const getAreaHouse = (id) => {
  return request({
    method: 'GET',
    url: '/area/map',
    params: {
      id,
    },
  })
}

/**
 * 根据关键字实现小区查询
 */
export const getAreaHouseByName = (params) => {
  return request.get('/area/community', {
    params,
  })
}
